<!--
 * @Description: 
 * @Author: mxy
 * @Date: 2022-11-27 21:06:52
 * @LastEditors: mxy
 * @LastEditTime: 2022-11-27 21:06:53
-->
<!--
 * @Description: 
 * @Author: mxy
 * @Date: 2022-11-27 20:37:20
 * @LastEditors: mxy
 * @LastEditTime: 2022-11-27 21:06:16
-->
<template>
  <div>
    <h2>事件绑定指令令</h2>
    <p>{{ num }}</p>
    <button v-on:click="num++">点击加一</button>
    <button @click="num--">点击减一</button>
    <hr />
    <button @click="multiple">点击二倍</button>
    <hr />
    <button @click="one(3, 4, $event)">111</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: 20,
    };
  },
  methods: {
    multiple() {
      this.num = this.num * 2;
    },
    one(a, b, e) {
      console.log(a + b, e.target);
    },
  },
};
</script>

<style>
h2 {
  color: red;
}
</style>
